;read file1 text
ioResult==ReadFileA(buffer file1 offset count)
if ioResult=-1
   hlt 'cannot access the file'
end if

;end text with null
ub[buffer+ioResult]=0

;cypher text
call cypher
goto cypher.
cypher:
c==ioResult
while c
  ub[buffer+c-1]=ub[buffer+c-1] xor 'x'
  c==c-1
end while
ret
.:

;store cyphered text to file2
pause
SetEndOfFileA file2 0
pause
ioResult==WriteFileA(buffer file2 offset ioResult)

;uncypher back and display
call cypher
;MessageBoxA(buffer file1 0)
msg buffer








offset=0
count=65'535

buffer: rb count

file1: ub '../tst/file access, cypher.txt',0
file2: ub '../tst/cypher-ed.txt',0
